import { commonRequest } from '@/api/commonHttp';

// 商品基础 - 计量单位管理 - 计量单位待审核 - 获取详情
export const baseGetByUuidService = (data, target) => commonRequest({
  url: '/sysback/unitaudit/baseGetByUuid',
  type: 'post',
  data,
  target,
  isFormData: true
});

// 商品基础 - 计量单位管理 - 计量单位待审核 - 审核不通过
export const auditNoPassService = (data, loadingFn) => commonRequest({
  url: `/sysback/unitaudit/auditNoPass?uuids=${data.uuids}&auditNote=${data.auditNote}`,
  type: 'post',
  data,
  loadingFn,
});

// 商品基础 - 计量单位管理 - 计量单位待审核 - 审核通过
export const auditPassService = (data, loadingFn) => commonRequest({
  url: `/sysback/unitaudit/auditPass?uuids=${data.uuids}&auditNote=${data.auditNote}`,
  type: 'post',
  data,
  loadingFn,
});

// 获取计量单位待审核列表
export const getAuditListService = (data, loadingFn) => commonRequest({
  url: '/sysback/unitaudit/baseQueryList',
  type: 'post',
  data,
  loadingFn,
});

// 删除审核未通过计量单位
export const deleteAuditFailUnitService = (data, loadingFn) => commonRequest({
  url: '/sysback/unitaudit/deleteUnitByUuid',
  type: 'post',
  data,
  loadingFn,
  isFormData: true,
});
